package cn.yunhe.servlet;

import cn.yunhe.services.OrderConShowService;
import cn.yunhe.services.OrderShowService;
import net.sf.json.JSONArray;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * 李非凡
 * 订单详情展示servlet
 */
@WebServlet("/shangjia/OrderConShowServlet")
public class OrderConShowServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/json;charset=UTF-8");
        PrintWriter out = response.getWriter();
        //oid的取值
        String oid= request.getParameter("oid");
        OrderConShowService orderConShowService=new OrderConShowService();
        JSONArray jsonArray=orderConShowService.getOrderCon(oid);//oid从页面session取值
        out.print(jsonArray);
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }
}
